package com.zego.wawaji.ui.bean.banner;

import android.os.Parcel;
import android.os.Parcelable;

import com.zego.wawaji.base.data.BaseData;

import org.json.JSONObject;

/**
 * 公告
 * Created by Su on 2017/12/4.
 */
public class Notice extends BaseData implements Parcelable{
    private String img;    // 轮播图片地址
    private String link;   // 公告关联H5页面地址

    @Override
    public void parseJson(String jsonStr) {
        JSONObject jsonObject = getJsonObject(jsonStr);

        this.img = jsonObject.optString("Img");
        this.link = jsonObject.optString("Link");
    }

    public String getImg() {
        return img;
    }

    public String getLink() {
        return link;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.img);
        dest.writeString(this.link);
    }

    public Notice() {
    }

    protected Notice(Parcel in) {
        this.img = in.readString();
        this.link = in.readString();
    }

    public static final Creator<Notice> CREATOR = new Creator<Notice>() {
        @Override
        public Notice createFromParcel(Parcel source) {
            return new Notice(source);
        }

        @Override
        public Notice[] newArray(int size) {
            return new Notice[size];
        }
    };
}
